/* 
 * File:   MSFReader.h
 * Author: hyjkim
 *
 * Reads in a MSF file and outputs a multiple alignment object
 *
 * Created on July 18, 2012, 2:44 PM
 */

#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
#include <map>

class multipleAlignment {
    std::map<std::string,std::string> _seq;
    size_t _length;
    std::map<char, std::vector<size_t> > _profile;
    //std::vector<std::map<char, double> > _profile;
    std::vector<std::map<char, size_t> > _counts;

    public:
    void __addNewRef(std::string name, int length); 
    void __appendSeq(std::vector<std::string> elems);
    void __calculateProfile();
    void printAllSeq();
    void setLength(size_t length);
    size_t getLength();
    void printProfile();
    void printConsensus();

};

class MSFReader {
    void __printHeader(std::ifstream *file);
    void __printNextAlignmentBlock(std::ifstream *file);
    void __parseHeader(multipleAlignment *align, std::ifstream *file);
    void __storeAlignments(multipleAlignment *align, std::ifstream *file);

    public:
    void openMSF(std::string filename);
};


